package com.coderman.basketball.infrast.adapter.impl;

import com.coderman.basketball.infrast.adapter.GameDataAdapterService;
import com.coderman.basketball.infrast.adapter.dto.GameDataResponse;
import com.coderman.basketball.infrast.adapter.dto.GamePlayerDataResponse;
import com.coderman.basketball.statistics.api.GameDataService;
import com.coderman.basketball.statistics.dto.GameDataDTO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Description:
 * date: 2021/5/28
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 * 防腐层
 */
@Service
public class GameDataAdapterServiceImpl implements GameDataAdapterService {


    private GameDataService gameDataService;

    @Override
    public List<GamePlayerDataResponse> getPlayerDataByGameId(Long gameId) {
        return null;
    }

    @Override
    public GameDataResponse getGameDataByGameId(Long gameId) {
        GameDataResponse gameDataResponse = new GameDataResponse();
        GameDataDTO gameDataDTO = gameDataService.getGameDataByGameId(gameId);
        gameDataResponse.setGameId(gameId);
        gameDataResponse.setScore(gameDataDTO.getScore());

        return gameDataResponse;
    }
}
